import request from './request.js';
export function getdictType(data) {
	return request({
		url: `/system/dict/data/type/${data}`,
		method: 'get',
	})
}
export function getdict(data) {
	return request({
		url: `/sys/text/query/${data}`,
		method: 'get',
	})
}
export function login(data) {
	return request({
		url: `/mini/login/auth`,
		method: 'POST',
		data
	})
}

export function gettips(data) {
	return request({
		url: `/sys/tips/all`,
		method: 'POST',
		data
	})
}
export function getbanner(data) {
	return request({
		url: `/sys/banner/all`,
		method: 'POST',
		data
	})
}
export function getcategory(data) {
	return request({
		url: `/category/children/list/`,
		method: 'POST',
		data
	})
}
export function getshoplist(data) {
	return request({
		url: `/mini/product/list/hot`,
		method: 'POST',
		data
	})
}
export function getproductinfo(data) {
	return request({
		url: `/mini/product/info`,
		method: 'POST',
		data
	})
}
// 分类列表

export function getproductcategory(data) {
	return request({
		url: `/mini/product/list/category`,
		method: 'POST',
		data
	})
}
//购物车数量更新
export function setShopCarCount(data) {
	return request({
		url: `/mini/car/update/by/count`,
		method: 'POST',
		data
	})
}
//购物车移除
export function removeShopCar(data) {
	return request({
		url: `/mini/car/remove`,
		method: 'POST',
		data
	})
}
//购物车列表
export function getShopCar(data) {
	return request({
		url: `/mini/car/list`,
		method: 'POST',
		data
	})
}
//个人信息
export function getUserInfo(data) {
	return request({
		url: `/mini/wechat/user/info`,
		method: 'POST',
		data
	})
}
export function setPhone(data) {
	return request({
		url: `/mini/wechat/user/bind/phone`,
		method: 'POST',
		data
	})
}
//修改个人信息
export function setUserInfo(data) {
	return request({
		url: `/mini/wechat/user/edit`,
		method: 'POST',
		data
	})
}
//地址列表
export function addressList(data) {
	return request({
		url: `/mini/wechat/user/address/list`,
		method: 'POST',
		data
	})
}
//地址
export function addressInfo(data) {
	return request({
		url: `/mini/wechat/user/address/info`,
		method: 'POST',
		data
	})
}
//地址添加
export function addressAdd(data) {
	return request({
		url: `/mini/wechat/user/address/add`,
		method: 'POST',
		data
	})
}
//地址修改
export function addressEdit(data) {
	return request({
		url: `/mini/wechat/user/address/edit`,
		method: 'POST',
		data
	})
}
//地址删除
export function addressRemove(data) {
	return request({
		url: `/mini/wechat/user/address/remove`,
		method: 'POST',
		data
	})
}
//地址默认
export function addressDefault(data) {
	return request({
		url: `/mini/wechat/user/address/default`,
		method: 'POST',
		data
	})
}
//查询配送费
export function deliveryAmount(data) {
	return request({
		url: `/mini/orders/delivery/amount`,
		method: 'POST',
		data
	})
}
// 创建订单
export function createOrder(data) {
	return request({
		url: `/mini/orders/add`,
		method: 'POST',
		data
	})
}
// 订单列表
export function ordersList(data) {
	return request({
		url: `/mini/orders/list`,
		method: 'POST',
		data
	})
}
// 订单详情
export function ordersInfo(data) {
	return request({
		url: `/mini/orders/info`,
		method: 'POST',
		data
	})
}
// 取消订单
export function ordersCancel(data) {
	return request({
		url: `/mini/orders/cancel`,
		method: 'POST',
		data
	})
}
// 继续支付
export function ordersPay(data) {
	return request({
		url: `/mini/orders/pay`,
		method: 'POST',
		data
	})
}
// 申请退款
export function createRefund(data) {
	return request({
		url: `/mini/orders/refund`,
		method: 'POST',
		data
	})
}
// 确认送达
export function createArrive(data) {
	return request({
		url: `/mini/orders/finish`,
		method: 'POST',
		data
	})
}
// 待支付
export function notpay(data) {
	return request({
		url: `/mini/orders/not/pay/count`,
		method: 'POST',
		data
	})
}

// 搜索
export function searchShop(data) {
	return request({
		url: `/mini/product/search`,
		method: 'POST',
		data
	})
}
export function ordersRefund(data) {
	return request({
		url: `/mini/orders/refund`,
		method: 'POST',
		data
	})
}

export function ordersMonth(data) {
	return request({
		url: `/mini/orders/list/month`,
		method: 'POST',
		data
	})
}

export function ordersMonthPay(data) {
	return request({
		url: `/mini/orders/batch/pay`,
		method: 'POST',
		data
	})
}



